package com.ljx.itbbs.server.article.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@TableName("tb_resource")
public class ResourceEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("资源ID")
    private Long id;

    @ApiModelProperty("文章ID")
    @TableField("article_id")
    private Long articleId;

    @ApiModelProperty("上传用户ID")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty("资源路径")
    @TableField("res_url")
    private String resUrl;

    @ApiModelProperty("文件名称")
    @TableField("filename")
    private String filename;

    @ApiModelProperty("文件大小")
    @TableField("filesize")
    private Long filesize;

    @ApiModelProperty("是否免费（1：收费，2：免费）")
    @TableField("is_free")
    private Integer isFree;

    @ApiModelProperty("所需积分")
    @TableField("integral")
    private Integer integral;

    @ApiModelProperty("文件类型")
    @TableField("file_type")
    private String fileType;

    @ApiModelProperty("下载次数")
    @TableField("download_num")
    private Integer downloadNum;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty("创建时间")
    @TableField("create_time")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty("修改时间")
    @TableField("update_time")
    private Date updateTime;

    @ApiModelProperty("状态（1：正常，2：禁用）")
    @TableField("status")
    private Integer status;

}
